/*
 * Copyright © 2023-2025 puyinzhen
 * All rights reserved.
 *
 * The copyright of this work (or idea/project/document) is owned by puyinzhen. Without explicit written permission, no part of this work may be reproduced, distributed, or modified in any form for commercial purposes.
 *
 * This copyright statement applies to, but is not limited to: concept descriptions, design documents, source code, images, presentation files, and any related content.
 *
 * For permission to use this work or any part of it, please contact 1182810784@qq.com to obtain written authorization.
 */

.image-source {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #1E1E2F;
  padding: 16px;
  box-sizing: border-box;
  font-family: 'Inter', 'Helvetica Neue', sans-serif;

  .image-source-search {
    margin-bottom: 16px;

    .image-search-input {
      background-color: #2C2C3E;
      border: 1px solid #3A3A4E;
      border-radius: 4px;
      color: #FFFFFF;
      height: 32px;
      transition: all 0.2s ease;

      &:hover,
      &:focus {
        border-color: #4FB8FF;
        box-shadow: 0 0 0 2px rgba(79, 184, 255, 0.2);
      }

      &::placeholder {
        color: #A0A0B2;
      }

      .ant-input-prefix {
        margin-right: 8px;
      }

      .search-icon {
        color: #A0A0B2;
        font-size: 16px;
      }

      .ant-input-clear-icon {
        color: #A0A0B2;

        &:hover {
          color: #FFFFFF;
        }
      }
    }
  }

  .image-source-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    scrollbar-color: #3A3A4E #2C2C3E;

    .image-source-item {
      display: flex;
      flex-direction: column;
      height: 180px;
      background-color: #2C2C3E;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
      transition: all 0.2s ease;
      cursor: grab;

      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        border: 1px solid #4FB8FF;
      }

      &:active {
        cursor: grabbing;
      }

      .image-source-item-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 12px;
        background-color: rgba(40, 40, 58, 0.8);
        border-bottom: 1px solid #3A3A4E;

        .isi-title {
          font-size: 12px;
          color: #FFFFFF;
          font-weight: 500;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          max-width: 120px;
        }

        .isi-operate {
          .delete-icon {
            color: #A0A0B2;
            font-size: 14px;
            transition: all 0.2s ease;
            padding: 2px;
            border-radius: 2px;

            &:hover {
              color: #FF6E6E;
              background-color: rgba(255, 110, 110, 0.1);
            }
          }
        }
      }

      .image-source-item-body {
        flex: 1;
        padding: 8px;

        .item-bg-image {
          width: 100%;
          height: 100%;
          border-radius: 4px;
          background-color: #1E1E2F;

          background-size: contain;
          background-position: center;
          background-repeat: no-repeat;
          image-rendering: auto;
          object-fit: contain;
        }

      }
    }
  }
}

// Popconfirm样式覆盖
.image-source-popconfirm {
  .ant-popover-inner {
    background-color: #2C2C3E;
    border: 1px solid #3A3A4E;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);

    .ant-popconfirm-title {
      color: #FFFFFF;
      font-size: 14px;
    }

    .ant-popconfirm-description {
      color: #A0A0B2;
      font-size: 12px;
    }
  }
}

.primary-btn {
  background-color: #4FB8FF !important;
  border-color: #4FB8FF !important;
  color: #FFFFFF !important;
}

.secondary-btn {
  background-color: transparent !important;
  border-color: #4FB8FF !important;
  color: #4FB8FF !important;
}